package com.core;

import java.lang.invoke.SwitchPoint;

import com.objects.Seat;

public class SeatManager {
	public Seat searchQuadrant(){
		Seat seat = new Seat();
		return seat;
	}
	
	public boolean updateSeat(){
		return false;
	}
	
	public boolean deleteSeat(){
		return false;
	}
	
	public String parseSeatCode(String seatCode, SeatCode part){
		
		switch (part) {
		case LOCATIONCODE :
			seatCode = seatCode.substring(0, 3);
			break;
		case FLOOR :
			seatCode = seatCode.substring(3, 5);
			break;
		case QUADRANT :
			seatCode = seatCode.substring(5, 6);
			break;
		case COLUMN :
			seatCode = seatCode.substring(6, seatCode.length() -(seatCode.length() -seatCode.lastIndexOf("-")));
			break;
		case ROW :
			seatCode = seatCode.substring(seatCode.lastIndexOf("-")+1, seatCode.length());
			break;
		}
		
		return seatCode;
	}
	
	public enum SeatCode {
		LOCATIONCODE,
		FLOOR,
		QUADRANT,
		COLUMN,
		ROW;
	}

}
